package com.learn.sunday.stock.controller;

import com.learn.sunday.common.service.ResponseUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicLong;

@RestController
@RequestMapping("file/v1")
@Slf4j
public class FileController {

    private AtomicLong seq = new AtomicLong();

    @PostMapping("upload")
    public ResponseUtil upload(HttpServletRequest request, @RequestParam String token, @RequestParam String fileType) throws IOException {

        long andIncrement = seq.incrementAndGet();
        log.info("seq={}",andIncrement);
        return ResponseUtil.success();
    }
}
